﻿using System;
using System.Web.UI.Design;

namespace BizElements.Web
{
    /// <summary>
    /// Performs design-time rendering of a <see cref="TemplatePopupButton"/> control.
    /// </summary>
    public class TemplatePopupButtonDesigner : ControlDesigner
    {
        #region GetDesignTimeHtml.

        /// <summary>
        /// Retrieves the HTML markup that is used to represent the control at design time.
        /// </summary>
        /// <returns>The HTML markup used to represent the control at design time.</returns>
        public override string GetDesignTimeHtml()
        {
            TemplatePopupButton lookup = (TemplatePopupButton)this.Component;
            bool wasVisible = lookup.Visible;
            lookup.Visible = true;
            string designTimeHtml = lookup.GetDesignTimeHtml();
            lookup.Visible = wasVisible;
            return designTimeHtml;
        }

        #endregion
    }
}
